package com.ruoyi.point.service.impl;

import com.ruoyi.point.mapper.HistoricalAlarmMapper;
import com.ruoyi.point.pojo.HistoricalAlarm;
import com.ruoyi.point.service.IHistoricalAlarmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 历史报警管理Service业务层处理
 *
 * @author ruoyi
 * @date 2024-04-22
 */
@Service
public class HistoricalAlarmServiceImpl implements IHistoricalAlarmService
{
    @Autowired
    private HistoricalAlarmMapper historicalAlarmMapper;

    /**
     * 查询历史报警管理
     *
     * @param equipmentId 历史报警管理主键
     * @return 历史报警管理
     */
    @Override
    public HistoricalAlarm selectHistoricalAlarmByEquipmentId(Long equipmentId)
    {
        return historicalAlarmMapper.selectHistoricalAlarmByEquipmentId(equipmentId);
    }

    /**
     * 查询历史报警管理列表
     *
     * @param historicalAlarm 历史报警管理
     * @return 历史报警管理
     */
    @Override
    public List<HistoricalAlarm> selectHistoricalAlarmList(HistoricalAlarm historicalAlarm)
    {
        return historicalAlarmMapper.selectHistoricalAlarmList(historicalAlarm);
    }

    /**
     * 新增历史报警管理
     *
     * @param historicalAlarm 历史报警管理
     * @return 结果
     */
    @Override
    public int insertHistoricalAlarm(HistoricalAlarm historicalAlarm)
    {
        return historicalAlarmMapper.insertHistoricalAlarm(historicalAlarm);
    }

    /**
     * 修改历史报警管理
     *
     * @param historicalAlarm 历史报警管理
     * @return 结果
     */
    @Override
    public int updateHistoricalAlarm(HistoricalAlarm historicalAlarm)
    {
        return historicalAlarmMapper.updateHistoricalAlarm(historicalAlarm);
    }

    /**
     * 批量删除历史报警管理
     *
     * @param equipmentIds 需要删除的历史报警管理主键
     * @return 结果
     */
    @Override
    public int deleteHistoricalAlarmByEquipmentIds(Long[] equipmentIds)
    {
        return historicalAlarmMapper.deleteHistoricalAlarmByEquipmentIds(equipmentIds);
    }

    /**
     * 删除历史报警管理信息
     *
     * @param equipmentId 历史报警管理主键
     * @return 结果
     */
    @Override
    public int deleteHistoricalAlarmByEquipmentId(Long equipmentId)
    {
        return historicalAlarmMapper.deleteHistoricalAlarmByEquipmentId(equipmentId);
    }
}
